<template>
	<view class="h-full p-x-30 bg-color-lightgrey">
		<scroll-view scroll-y style="max-height: 100vh" lower-threshold="50" @scrolltolower="onPushRefresh()">
			<slot />
			<up-loadmore :status="loadmoreStatus" :loadmore-text="loadText.loadmore" :loading-text="loadText.loading"
				:nomore-text="loadText.nomore" />
		</scroll-view>
		<g-tab-bar :activeTabName="activeTabName" />
	</view>
</template>

<script setup>
	const props = defineProps({
		// 激活的菜单索引
		activeTabName: {
			type: String,
			required: true,
		},
		loadmoreStatus: {
			type: String,
			required: true,
		},
	});
	const loadText = ref({
		loadmore: "上拉加载更多",
		loading: "加载中...",
		nomore: "没有数据了！",
	});
	const emit = defineEmits(["onPushRefresh"]);
	const onPushRefresh = () => {
		emit("onPushRefresh");
	};
</script>

<style></style>